#include <QLabel>
#include <QDebug>
#include "CPaginationForm.h"
#include "ui_CPaginationForm.h"

CPaginationForm::CPaginationForm(CPagination ps, QWidget *parent) :
    QDialog(parent),
    ui(new Ui::CPaginationForm)
{
    pagination = ps;
    ui->setupUi(this);
    ui->pagination->setChecked(pagination.isPagination());
    ui->comboLocation->setCurrentIndex(pagination.getLocation());
    ui->comboAlignment->setCurrentIndex(pagination.getAlignment());
    ui->firstPage->setChecked(pagination.getFirstPageNumbered());
    ui->startPage->setValue(pagination.getStartPage());
}

CPaginationForm::~CPaginationForm()
{
    //delete printSettings;
    delete ui;
}

CPagination CPaginationForm::getPaginationSetting()
{
    pagination.setPagination(ui->pagination->isChecked());
    pagination.setLocation(CPagination::Location(ui->comboLocation->currentIndex()));
    pagination.setAlignment(CPagination::Alignment(ui->comboAlignment->currentIndex()));
    pagination.setFirstPageNumbered(ui->firstPage->isChecked());
    pagination.setStartPage(ui->startPage->value());
    return pagination;
}
